package com.wdzr.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wdzr.mapper.ProjectMapper;
import com.wdzr.model.Project;
import com.wdzr.service.ProjectService;

@Service
public class ProjectServiceImpl implements ProjectService {

    /**
     * 注入ProjectMapper接口
     */
    @Autowired
    private ProjectMapper projectMapper;

    /**
     * 新增项目
     */
    public boolean saveProject(Project project) {
        return projectMapper.saveProject(project);
    }

    /**
     * 更新项目
     */
    public boolean updateProject(Project project) {
        return projectMapper.updateProject(project);
    }

    /**
     * 根据Id删除项目
     */
    public boolean deleteProject(int id) {
        return projectMapper.deleteProject(id);
    }

    /**
     * 根据id查找项目
     */
    public Project findProjectById(int id) {
    	Project project = projectMapper.findProjectById(id);
        return project;
    }

    /**
     * 查询所有项目
     */
    public List<Project> findAll() {
        List<Project> allProject = projectMapper.findAll();
        return allProject;
    }

}
